<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%><%@taglib
	uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
	uri="https://ajax4jsf.dev.java.net/ajax" prefix="ajax"%><%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="styles/style.css" type="text/css" rel="stylesheet"></link>
<title>Insert title here</title>
</head>
<body>

<div class="mainBackground">
			<div class="innerBackground">
	
<f:view locale="#{visitInfo.currentUser.locale}">
	<f:loadBundle basename="resources.VisionClickResources" var="msg"/>
	<jsp:include page="nav.jsp"></jsp:include>

	<div class="table" style="width:960px;">
		<div class="tableHead" style="width:960px">
	<h:form>
		<h:panelGrid border="0" columns="4" width="960">
			<h:outputText value="#{msg.ProjectName}" style="color:white"></h:outputText>
			<h:outputText value="#{visitInfo.currentProject.projectName}"></h:outputText>
			<h:panelGroup style="float:right;">
				<h:commandLink value="#{msg.EditRule}" action="rules" style="margin-right:10px;color:white" rendered="#{visitInfo.currentUser.canCreateUserStory}"></h:commandLink>
				<h:commandLink value="+#{msg.AddUserStory}" action="addUserStory" style="margin-right:10px;color:white" rendered="#{visitInfo.currentUser.canCreateUserStory}"></h:commandLink>
				<h:commandLink value="+#{msg.AddSprint}" action="addSprint" style="margin-right:5px;color:white" rendered="#{visitInfo.currentUser.canCreateTask}"></h:commandLink>
			</h:panelGroup>
		</h:panelGrid>
	</h:form>
	</div>
			<h:form>
				<h:panelGrid border="0" columns="2" width="960">
					<h:outputText value="#{msg.Creator}"></h:outputText>
					<h:outputText value="#{visitInfo.currentProject.creator}">
						<f:converter converterId="userConverter"/>
					</h:outputText>
					<h:outputText value="#{msg.CreateDate}"></h:outputText>
					<h:outputText value="#{visitInfo.currentProject.createDate}"></h:outputText>
					<h:outputText value="#{msg.ProjectDesc}"></h:outputText>
					<h:outputText value="#{visitInfo.currentProject.projectDesc}"></h:outputText>
					<h:outputText value="#{msg.Members}"></h:outputText>
					<h:panelGroup >
						<h:dataTable border="0" value="#{projectBean.projectMembers}" var="member" >
						<h:column id="column1">
							<h:outputText value="#{member.userName}"></h:outputText>
						</h:column>	
						<h:column id="column2">
							<h:outputText value="#{member.currentRole}"></h:outputText>
						</h:column>
						<h:column id="column3" rendered="#{visitInfo.currentUser.canCreateUserStory && !member.canCreateUserStory}">
								<h:commandLink value="#{msg.PromotToSM}" action="#{userBean.appointSM}">
									<f:param value="#{member.userId}" name="userId"></f:param>
								</h:commandLink>
						</h:column>
						<h:column id="column4" rendered="#{visitInfo.currentUser.canCreateUserStory && !member.canCreateUserStory}">
								<h:commandLink value="#{msg.ResignToTM}" action="#{userBean.apponitTM}">
									<f:param value="#{member.userId}" name="userId"></f:param>
								</h:commandLink>
						</h:column>
						</h:dataTable>
					</h:panelGroup>
										
				</h:panelGrid>
				</h:form>
		</div>
					
				<ajax:repeat value="#{sprintBean.projectSprint}" var="sprint">
					<div class="table" style="width:960px;">
						<div class="tableHead" style="width:960px;">
							<h:form>
							<h:commandLink value="Sprint:#{sprint.sprintName}" action="showsprint" style="color:white">
								<f:param name="sprintId" value="#{sprint.sprintId}"/>
							</h:commandLink>
							</h:form>
						</div>
					</div>
				</ajax:repeat>
				
				<ajax:repeat value="#{userStoryBean.projectUserStory}" var="userStory">
					<div class="table" style="width:960px;">
						<div class="tableHead" style="width:960px;">
							<h:form>
								<h:panelGrid columns="3" border="0" style="width:960px;">
									<h:commandLink value="UserStory:#{userStory.userStoryName}" action="showuserstory" style="color:white">
										<f:param name="userStoryId" value="#{userStory.userStoryId}"/>
									</h:commandLink>
									<h:graphicImage url="images/abandon.png" style="height:25px;float:right;" rendered="#{userStory.abandoned}"></h:graphicImage>
								</h:panelGrid>
							</h:form>
						</div>
					</div>
				</ajax:repeat>
				
				
			</f:view>
	</div>
	</div>	
</body>
</html>